org.eclipse.vtp.framework.engine.runtime
Class Builder

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.runtime.Builder

public abstract class Builder
extends java.lang.Object

A factory class that can construct and configure instances of a component.

Author:
Lonnie Pryor

Constructor Summary
protected Builder()
          Creates a new Builder.
 
Method Summary
 void configure()
          Configures the currently active component instance.
 java.lang.Object create()
          Creates an instance of the component.
protected abstract  IContext createServiceRegistry()
          Creates a service registry for the current scope.
protected abstract  java.lang.reflect.Constructor[] getConstructors()
          Returns the constructors for the component.
protected abstract  java.lang.reflect.Method[] getMutators()
          Returns the mutator methods of the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Builder

protected Builder()
Creates a new Builder.

Method Detail

create

public java.lang.Object create()
                        throws java.lang.IllegalStateException
Creates an instance of the component.

Returns:
The new component instance or null if it could not be created.
Throws:
java.lang.IllegalStateException - If a previously created component has not been configured.

configure

public void configure()
               throws java.lang.IllegalStateException
Configures the currently active component instance.

Throws:
java.lang.IllegalStateException - If there is no currently active component instance.

getConstructors

protected abstract java.lang.reflect.Constructor[] getConstructors()
Returns the constructors for the component.

Returns:
The constructors for the component.

getMutators

protected abstract java.lang.reflect.Method[] getMutators()
Returns the mutator methods of the component.

Returns:
The mutator methods of the component.

createServiceRegistry

protected abstract IContext createServiceRegistry()
Creates a service registry for the current scope.

Returns:
A new service registry for the current scope.